
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()
            +":"+request.getServerPort()+path+"/";
    pageContext.setAttribute("basePath",basePath);
%>
<html>
<head>
    <title>Title</title>
</head>
<body>

<form action="${pageContext.request.contextPath }/login" method="post">
    <table>
        <tr>
            <input type="text" name="a" value="<%=basePath%>"/>
            <input type="text" name="b" value="${pageContext.request.contextPath }"/>
            <td>用户名：</td><td><input type="text" name="name"/></td>
        </tr>
        <tr>
            <td>密   码：</td><td><input type="password" name="password"/></td>
        </tr>
    </table>
    <input type="submit" value="登录"/><br/>
</form>
</body>
</html>
